package com.lx.vcode.web;


import com.lx.vcode.VcodeException;
import com.lx.bean.Result;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


//AOP 实现的异常拦截
@RestControllerAdvice
@Component
public class VcodeExHandler {

    @ExceptionHandler(VcodeException.class)
    Object handleVcodeException(VcodeException e){
        return new Result(0, e.getMessage(), null);
    }
}
